<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright © 2022-2024 Petr Panteleyev <petr-panteleyev@yandex.ru>
  SPDX-License-Identifier: BSD-2-Clause
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.4</version>
        <relativePath/>
    </parent>

    <groupId>org.panteleyev.money</groupId>
    <artifactId>money-manager-backend</artifactId>
    <version>${revision}</version>
    <name>Backend</name>

    <properties>
        <revision>24.7.1</revision>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>22</java.version>
        <maven.compiler.release>22</maven.compiler.release>
        <!-- Plugins -->
        <mavenResourcePluginVersion>3.3.1</mavenResourcePluginVersion>
        <mavenCompilerPluginVersion>3.13.0</mavenCompilerPluginVersion>
        <mavenJarPluginVersion>3.3.0</mavenJarPluginVersion>
        <mavenSurefirePluginVersion>3.2.5</mavenSurefirePluginVersion>
        <jpackageMavenPluginVersion>1.6.3</jpackageMavenPluginVersion>
        <!-- Dependencies -->
        <postgresVersion>42.7.2</postgresVersion>
        <liquibaseVersion>4.20.0</liquibaseVersion>
        <springDocsVersion>1.6.15</springDocsVersion>
        <caffeineVersion>3.1.1</caffeineVersion>
        <graphqlJavaExtendedScalarsVersion>19.1</graphqlJavaExtendedScalarsVersion>
        <restAssuredVersion>5.3.0</restAssuredVersion>
        <hamcrestVersion>2.2</hamcrestVersion>
        <testContainersVersion>1.17.3</testContainersVersion>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testContainersVersion}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured-common</artifactId>
                <version>${restAssuredVersion}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-graphql</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
        </dependency>
        <dependency>
            <groupId>org.panteleyev.money</groupId>
            <artifactId>money-manager-model</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgresVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>${springDocsVersion}</version>
        </dependency>
        <dependency>
            <groupId>com.graphql-java</groupId>
            <artifactId>graphql-java-extended-scalars</artifactId>
            <version>${graphqlJavaExtendedScalarsVersion}</version>
        </dependency>
        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <version>${caffeineVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${restAssuredVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>xml-path</artifactId>
            <version>${restAssuredVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.panteleyev.money</groupId>
            <artifactId>money-manager-client</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${mavenResourcePluginVersion}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${mavenCompilerPluginVersion}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${mavenJarPluginVersion}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${mavenSurefirePluginVersion}</version>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <outputDirectory>${project.build.directory}/jar</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.panteleyev</groupId>
                <artifactId>jpackage-maven-plugin</artifactId>
                <version>${jpackageMavenPluginVersion}</version>
                <configuration>
                    <name>Money Manager Backend</name>
                    <appVersion>${project.version}</appVersion>
                    <vendor>panteleyev.org</vendor>
                    <runtimeImage>${java.home}</runtimeImage>
                    <input>${project.build.directory}/jar</input>
                    <mainJar>money-manager-backend-${project.version}.jar</mainJar>
                    <mainClass>org.springframework.boot.loader.JarLauncher</mainClass>
                    <destination>target/dist</destination>
                </configuration>
                <executions>
                    <execution>
                        <id>linux</id>
                        <configuration>
                            <type>APP_IMAGE</type>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
